package com.zb.ssm.controller;


import com.zb.ssm.entity.EmpEntity;
import com.zb.ssm.entity.Result;
import com.zb.ssm.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("emp")
public class EmpController {

    @Autowired
    private EmpService empService;

    @RequestMapping("insert")
    public Result<?> insert(EmpEntity empEntity){
        return empService.insert(empEntity);
    }

    @RequestMapping("deleteById")
    public Result<?>  deleteById(int id){
        return empService.deleteById(id);
    }

    @RequestMapping("updateById")
    public Result<?>  updateById(EmpEntity empEntity){
        return empService.updateById(empEntity);
    }

    @RequestMapping("select")
    public Result<List<EmpEntity>> select(){
        return empService.select();
    }

    @RequestMapping("selectById")
    public Result<EmpEntity> selectById(int id){
        return empService.selectById(id);
    }
}
